package com.example.memurbac_service.servicelmp;

import com.example.memurbac_service.dao.RoleMapper;
import com.example.memurbac_service.pojo.Role;
import com.example.memurbac_service.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleMapper mapper;

    @Override
    public List<Role> SelectRole() {
        return mapper.SelectRole();
    }

    @Override
    public List<Role> getSelectRole(String role_name) {
        return mapper.getSelectRole(role_name);
    }



    @Override
    public int AddRole( String role_name, String role_desc,int role_type) {
        return mapper.AddRole(role_name, role_desc, role_type);
    }

    @Override
    public int DelRole(int id) {
        return mapper.DelRole(id);
    }

    @Override
    public int offrole(int roleid) {
        return mapper.offrole(roleid);
    }

    @Override
    public int onrole(int roleid) {
        return mapper.onrole(roleid);
    }

    //根据id查询角色信息
    @Override
    public Role selectidrole(int roleid) {
        return mapper.selectidrole(roleid);
    }

    @Override
    public int UpdRole(int id, String role_name, String role_desc,  int role_type) {
        return mapper.UpdRole(id, role_name, role_desc, role_type);
    }
}
